<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/react.development.js" ></script>
    <script type="text/javascript" src="../js/react-dom.development.js" ></script>
    <script type="text/javascript" src="../js/babel.min.js" ></script>
    <style>
        .title{
            background-color: orange;
            width:500px;
        }
    </style>
</head>
<body>
    <div id="test"></div>
    <script type="text/babel">
        const content = "welcomTOHElloworld"
        // 1. 不要加引号
        // 2. 混入js表达式要用花括号
        // 3. 样式不用class，用className
        // 4. 内联样式用style={{key:value,key:value}}
        // 5. 只能有1个根标签
        // 6. 标签必须闭合
        // 7. 小写首字母标签直接转成同名html元素
        // 8. 大写首字母标签会被当做组件。如果没有定义则报错
        const arr=["1","2","3"]
        const vdom = (
            <div>
                <h1 className="title">
                    <span style={{color:'white'}}>{content.toLowerCase()}</span>
                </h1>
                <ul>
                {
                    arr.map((item,index)=>{
                        return <h1 key='index'>{item}</h1>
                    },)
                }    
                </ul>
            </div>
        )

        ReactDOM.render(vdom, document.getElementById("test"))
    </script>
</body>
</html>